//这是VUE的路由文件,所有的页面路由在此

import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/pages/home/Home.vue'
import City from '@/pages/city/City.vue'
import Detail from '@/pages/detail/Detail.vue'

Vue.use(Router)

export default new Router({
//这是一个路由数组
  routes: [
    {
//  	根目录
      path: '/',
      name: 'Home',
      component: Home
    },{
//  	city目录
    	path:'/city',
    	name:'City',
    	component:City
    },{
    	path:'/detail/:id',
    	name:'Detail',
    	component:Detail
    }],
//  消除全局滚动影响,页面滑动后不会对其他页面影响,每一个页面刷新后都是从(0,0)起始
    scrollBehavior(to,from,savedPosition){
    	return {x:0,y:0}
    }
})
